﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String content=request.getParameter("edt1");
if (content != null) {
  content = content.replaceAll("\r\n", "");
  content = content.replaceAll("\r", "");
  content = content.replaceAll("\n", "");
  content = content.replaceAll("\"", "'");
}else{
  content = "";
}

//下面是处理中文内容的编码转换
content = new String(content.getBytes("iso8859-1"),"utf-8");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>FCKEditor 测试</title>
	  <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
  </head>
  
  <body>
    This is my JSP page. <br>
    <form action="AdminServlet" method="POST" >
    <script type="text/javascript">
        var oFCKeditor = new FCKeditor("input");
        oFCKeditor.BasePath = "fckeditor/";
        oFCKeditor.Height='400';
        oFCKeditor.Value="<%=content%>";
        oFCKeditor.Create();
		
    </script>
    <input type="submit" value="提交"  >
    </form>
    <hr>
    <%=content%>

  </body>
</html>